﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Gqq.Common.Helper
{
    public class MathHelper
    {
        public static decimal GetValue(decimal dc, bool isDefault = true)
        {
            //如果是默认，则采用的是四舍六入五成双的方法。
            return isDefault ? Math.Round(dc, 2) : Math.Round(dc, 2, MidpointRounding.AwayFromZero);
        }

        public static int Add(int a, int b)
        {
            return a + b;
        }

        public static int Minus(int a, int b)
        {
            return a - b;
        }



        public static int Divide(int a, int b)
        {
            if (b == 0)
                return 0;
            return a / b;
        }



        public static int Multiply(int a, int b)
        {
            return a * b;
        }
    }
}
